import ProxyInterface from '../proxy-interface';
import {ApplicationModel, ApplicationPageModel} from '@pkpm/pkpm-types';

class ApplicationPageProxy implements ProxyInterface<ApplicationPageModel> {
    private applicationStatusPage = new ApplicationPageModel();

    constructor(responseData) {
        let data = responseData;
        Object.assign<ApplicationPageModel, any>(this.applicationStatusPage, data);
    }

    getModel(): ApplicationPageModel {
        return this.applicationStatusPage;
    }
}

class ApplicationProxy implements ProxyInterface<ApplicationModel> {
    private application = new ApplicationModel();

    constructor(responseData) {
        let data = responseData.data || responseData;
        Object.assign<ApplicationModel, any>(this.application, data);
    }

    getModel(): ApplicationModel {
        return this.application;
    }
}

export {ApplicationPageProxy, ApplicationProxy};
